<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>班级设置</title>
    
	<link href="<%=path%>/css/index_css.css" rel="stylesheet" type="text/css" />
	<script src="<%=path%>/js/resizeIframe.js" type="text/javascript"></script>
	<script type="text/javascript" src="<%=path %>/js/syAjax.js"></script>
	<script type="text/JavaScript">
	
	//添加班级
	function goAdd(gradeId)
	{
		var value=window.showModalDialog("<%=path %>/baseSet/classAndGrade/addClass.jsp?gradeId="+gradeId+"&t="+new Date(),'',"dialogHeight:200px;dialogWidth:250px;help=0;scroll=1;");
		if(value=='true')
		{
		  window.location.href="<%=path %>/findGradeAndClassBySchoolGradeAndClassAction.action?year=${applicationScope.currentYear}&t="+new Date();
		}
	}
	function addSimpleClass(gradeId){
		syAjax.request("post","<%=path %>/saveSimpleClassGradeAndClassAction.action","grade.gradeId="+gradeId+"&year=${currentYear}",
		{success:function(value){
			if(value=='true'){
			  window.location.href="<%=path %>/findGradeAndClassBySchoolGradeAndClassAction.action?year=${applicationScope.currentYear}&t="+new Date();
			}else{
				alert("添加失败！");
			}
		},fail:onFail,type:'plain'});
	}
	
	//跳转到修改班级名称页面
	function goUpdateClassName(classId)
	{
	    var values=window.showModalDialog("<%=path %>/getClassByClassIdGradeAndClassAction.action?year=${currentYear}&classes.classId="+classId+"&t="+new Date(),'',"dialogHeight:220px;dialogWidth:350px;help=0;scroll=1;");
	    if(values=="true")
	    {
			window.location.href="<%=path %>/findGradeAndClassBySchoolGradeAndClassAction.action?year=${applicationScope.currentYear}&t="+new Date();
		}
	}
	
	function tdClick(url)
	{
	  window.location.href=url;
	}
	</script>

  </head>
  
  <body onload="resizeIframe();">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td align="left" class="f_5">基本设置</td>
  </tr>
  <tr>
    <td height="1" bgcolor="#9DD12E"></td>
  </tr>
  <tr>
    <td align="left" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="bottom" background="images/sywesp_24.gif">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td align="left" valign="bottom" background="<%=path %>/images/sywesp_24.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
           
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/getGradeListGradeAndClassAction.action');" style="cursor:pointer;">年级设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
             <td width="70" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path %>/getGradeListGradeAndClassAction.action?setGraduation=true');" style="cursor:pointer;">毕业年级</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="images/sywesp_25.gif" class="f_9" nowrap="nowrap">班级设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="85" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path %>/getAllYearAndSchoolTermyearAndSchoolTermAction.action');" style="cursor:pointer;">年度学期设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path %>/findCourseByParentCourseIdCourseAction.action');" style="cursor:pointer;">学科设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="80" align="left"><table width="80" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path %>/findAllOrganizationByTypeorganizationAction.action?organization.orgType=1');" style="cursor:pointer;">教研组设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path %>/findAllCodeMaintenanceTypeCodeMaintenanceAction.action');" style="cursor:pointer;">选项配置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
             
            <td width="75" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/baseSet/openClose.jsp');" style="cursor:pointer;">开关控制</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
              <td width="70" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="images/sywesp_18.gif" class="f_6" style="cursor:pointer;" nowrap="nowrap" onclick="tdClick('<%=path %>/initMethodGraduationAndUpgradeAction.action');">毕业升级</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" style="cursor:pointer;" nowrap="nowrap" onclick="tdClick('<%=path %>/toClassSectionTimesListClassSectionTimesAction.action');">课时管理</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td align="left">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top" class="tb_8 border_2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left" valign="top">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="2" height="24" align="left" background="images/sywesp_21.gif"><img src="images/sywesp_20.gif" width="2" height="24" /></td>
                              <td align="left" background="images/sywesp_21.gif">
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td width="1%">&nbsp;</td>
                                    <td width="20%" align="left" class="f_8"><img src="images/sywesp_23.gif" width="8" height="22" align="absmiddle" />年级</td>
                                    <td width="56%" align="left" class="f_8"><img src="images/sywesp_23.gif" width="8" height="22" align="absmiddle" />班级</td>
                                    <td width="8%" align="left" class="f_8"><img src="images/sywesp_23.gif" width="8" height="22" align="absmiddle" />序号</td>
                                    <td width="15%" align="left" class="f_8"><img src="images/sywesp_23.gif" width="8" height="22" align="absmiddle" />操作</td>
                                  </tr>
                              </table>
                              </td>
                              <td width="4" align="right" background="images/sywesp_21.gif"><img src="images/sywesp_22.gif" width="4" height="24" /></td>
                            </tr>
                        </table>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" valign="top">
                        <c:choose>
                 		<c:when test="${! empty requestScope.gradeList}">
                        <c:forEach items="${requestScope.gradeList}" var="grade">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td height="25" align="left" valign="top" class="tb_7">
                              <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                  <tr>
                                    <td width="1%" align="right" valign="bottom">&nbsp;</td>
                                    <td width="20%" height="25" align="left" valign="bottom" class="f_4">${grade.name}(${stageMap[grade.stageId]})</td>
                                    <td width="56%" align="left" valign="bottom">&nbsp;</td>
                                    <td width="7%" valign="bottom">&nbsp;</td>
                                    <td width="15%" valign="bottom"><a href="javascript:addSimpleClass('${grade.gradeId}');"><img src="images/icon_15.gif" alt="对当前年级添加班级" width="17" height="16" border="0" /></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="deleteSchoolGradeRelationGradeAndClassAction.action?grade.gradeId=${grade.gradeId }" onclick="return confirm('确定删除${grade.name }？');"><img src="images/icon_11.gif" width="12" height="12" border="0" /></a></td>
                                  </tr>
                              </table>
                              </td>
                            </tr>
                          </table>
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                               <td height="25" align="left" valign="top" class="tb_7">
                               <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                   <c:choose>
	               	   				<c:when test="${! empty requestScope.map[grade.gradeId]}">
	               	     			<c:forEach items="${requestScope.map[grade.gradeId]}" var="clas">
                                   <tr>
                                     <td width="1%" align="right" valign="bottom">&nbsp;</td>
                                     <td width="20%" height="25" align="left" valign="bottom">&nbsp;</td>
                                     <td width="56%" align="left" valign="bottom">${clas.name}</td>
                                     <td width="7%" valign="bottom">${clas.sort }</td>
                                     <td width="15%" valign="bottom"><!--<a href="#"><img src="images/icon_13.gif" width="16" height="14" border="0" /></a>   -->&nbsp;<a href="javascript:goUpdateClassName('${clas.classId}')"><img src="images/icon_16.gif" width="12" height="14" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="delClassByClassIdGradeAndClassAction.action?classes.classId=${clas.classId}" onclick="return confirm('确定删除${clas.name}？');"><img src="images/icon_11.gif" width="12" height="12" border="0" /></a></td>
                                   </tr>
                                   </c:forEach>
	               	   				</c:when>
	               	  				<c:otherwise>
	               	  				 <td width="1%" align="right" valign="bottom">&nbsp;</td>
                                     <td width="20%" height="25" align="left" valign="bottom">&nbsp;</td>
                                     <td width="56%" align="left" valign="bottom"><font color="#CCCCCC">无相关班级</font></td>
                                     <td width="7%" valign="bottom">&nbsp;</td>
                                     <td width="15%" valign="bottom">&nbsp;</td>
	               	   				</c:otherwise>
	               	 				</c:choose>
                               </table>
                                </td>
                              </tr>
                            </table>
                            </c:forEach>
                            </c:when>
                 			<c:otherwise>
                   				<font color="#BBBBBB">无年级信息</font>
                 			</c:otherwise>
               				</c:choose>
                          </td>
                      </tr>
                  </table>
                  </td>
                </tr>
                <tr>
                  <td align="center">&nbsp;</td>
                </tr>
            </table></td>
          </tr>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="left" valign="top" class="tb_9 border_3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left"><img src="images/icon_14.gif" width="62" height="17" /></td>
                </tr>
                <tr>
                  <td height="30" align="left" valign="bottom"><a href="#"><img src="images/icon_15.gif" width="17" height="16" border="0" /></a> 表示对当前年级添加班级&nbsp;&nbsp;&nbsp;<a href="#"><img src="images/icon_16.gif" width="12" height="14" border="0" /></a> 表示修改当前班级名称&nbsp;&nbsp; <a href="#"><img src="images/icon_11.gif" width="12" height="12" border="0" /></a> 表示删除当前年级或班级&nbsp;&nbsp; <!-- <a href="#"><img src="images/icon_13.gif" width="16" height="14" border="0" /></a> 表示安排当前班级上课教室 --></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
</body>

</html>
